<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>translateAnimation</title>
    <style>
      @keyframes loop {
        0% {
          transform: translateX(0);
        }
        100% {
          transform: translateX(-100%);
        }
      }

      .box {
        white-space: nowrap;
      }

      .scrollContent {
        width: 600px;
        display: inline-block;
        text-align: center;
        animation: loop 3s linear infinite;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="scrollContent">这是一段可以滚动的文本</div>
    </div>
  </body>
</html>